var formidable = require('formidable')
module.exports = {
  dealUpload(req, res) {
    var form = new formidable.IncomingForm()
    form.keepExtensions = true
    form.uploadDir = __dirname
    form.parse(req, (err, fields, files) => {
      if (err) {throw err}
      console.log('_______fields', fields)
      console.log('_________files', files)
      res.writeHead(200, {'Content-Type': 'text/plain'})
      res.end('upload finished')
    })
  }
}